<?php 

/*	Author: Gustavo Palacios
	Author: Fernando Rodas

	Project: EPS, Ciencias y Sistemas, USAC. 2014-2015	
	*/
	
		?>
<!DOCTYPE html>
<html>
    <?php
	require_once("clases/funciones.php");
	$plantilla = new Funciones;
	echo $plantilla->headerAdmin("Proceso de produccion - CEMA","Sistema de costos ","Sistema de costos","Gestión de procesos - Ingreso de insumos"); 
	?>
	<head>
	<link href="css/multi-select.css" media="screen" rel="stylesheet" type="text/css">
	  <!-- jQuery 2.0.2 -->
        <script src="js/jquery.min.js"></script>
		
	<script>
window.onload=inicial();

function inicial()
{
Procesos();
TipoProcesos();
}

function TipoProcesos(){

var fd = new FormData();
fd.append("tipo", "3");
	$.ajax({
url: "clases/calculos.php",
type: "POST",
data:  fd,
contentType: false,
cache: false,
processData:false,
success: function(data){
$("#prod").html(data);

},
error: function(){} 	        
});

}

function Procesos()
{
var fd = new FormData();
fd.append("tipo", "4");
fd.append("proc", <?php echo $_GET["id"];?>);
	$.ajax({
url: "clases/calculos.php",
type: "POST",
data:  fd,
contentType: false,
cache: false,
processData:false,
success: function(data){
$("#insum").html(data);

},
error: function(){} 	        
});

}

$(document).ready(function() {
$("#uploadForm").on('submit',(function(e){
e.preventDefault();
var fd = new FormData(this);
fd.append("tipo", "5");
fd.append("proc", <?php echo $_GET["id"];?>);
$.ajax({
url: "clases/calculos.php",
type: "POST",
data:  fd,
contentType: false,
cache: false,
processData:false,
success: function(data){
$("#test").html(data);
$("#fase").val("");
Procesos();
},
error: function(){} 	        
});

}));
});

</script>

</head>


                <!-- Main content -->
                <section class="content">
					<div id="test">
					
					</div>
					
					
					<!--Comienzo de la tabla -->
					<div class="row">
                        <div class="col-xs-12">
						
						<div align="right">
						 <button type="submit" class="btn btn-xs  btn-default " name="agregarNoticia" onclick="Procesos()">

									&nbsp;<span class="glyphicon glyphicon-retweet" aria-hidden="true"></span> 
									
									</button>
									</div>
						
						<div class="box">
                                <div class="box-header">
                                    <h3 class="box-title">Procesos de cultivo - Ingreso de insumos</h3>
											<br>
										
                                </div><!-- /.box-header -->
						
                                <div class="box-body table-responsive">
									<center>
							<h4> Cultivo número: <?php echo $_GET["id"];?> </h4>
									</center>
                              <form id="uploadForm"  method="post">
							  <div class="form-group">
								   <table class="table table-bordered table-striped table-condensed">
                                        <thead>
                                            <col width="30%">
                                            
                                           
                                        </thead>
                                        <tbody>
											<tr>
                                                <td><b>Estación:</b></td>
                                                <td><center><?php echo $_GET["esta"]; ?></center></td>
											</tr>
											 <tr>
                                                <td><b>Producto:</b></td>
											<td><center><?php echo $_GET["prod"]; ?></center></td>

											 </tr>
											 <tr>
                                                <td><b>Proceso:</b></td>
                                                <td><center>
												 
											<input type="text" class="input" style="width:90%; height:25px;" id="fase" name="fase" required></center></td>

												
											 </tr>
											
								
											
                                        </tbody>
                                    </table>
									
									<br>
									<div align="right">

									        <button type="submit" class="btn btn-xs  btn-default " name="agregarNoticia">

									Agregar &nbsp;<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> 
									
									</button>
									
									
									
									
									</div>
									</div>
									</form>
									<br><br>
									
									<div id="insum">
									</div>
									
									
									
								
									
									</div>
                                </div><!-- /.box-body -->
                            </div><!-- /.box -->
						
						</div>
						
						</div>
			
					
					<!--Fin tabla -->
				

                </section><!-- /.content -->
            </aside><!-- /.right-side -->
        </div><!-- ./wrapper -->
<!-- Button trigger modal -->



 <!-- jQuery 2.0.2 -->
        <script src="js/jquery.min.js"></script>
        <!-- Bootstrap -->
        <script src="js/plugins/bootstrap.min.js" type="text/javascript"></script>
        <!-- AdminLTE App -->
        <script src="js/plugins/AdminLTE/app.js" type="text/javascript"></script>
  <!-- DATA TABES SCRIPT -->
        <script src="js/plugins/datatables/jquery.dataTables.js" type="text/javascript"></script>
        <script src="js/plugins/datatables/dataTables.bootstrap.js" type="text/javascript"></script>
		
		
        <!-- InputMask -->
        <script src="js/plugins/input-mask/jquery.inputmask.js" type="text/javascript"></script>
        <script src="js/plugins/input-mask/jquery.inputmask.date.extensions.js" type="text/javascript"></script>
        <script src="js/plugins/input-mask/jquery.inputmask.extensions.js" type="text/javascript"></script>
 
        
    </body>
	
	
	<?php
	echo $plantilla->footerAdmin();
	?>
</html>